package org.xmdl.silk.wrap;

import org.xmdl.silk.PrintStatement;
import org.xmdl.silk.ValueItem;
import org.xmdl.silk.impl.PrintStatementImpl;
import org.xmdl.silk.visit.Visitor;

public class PrintStatementWrap extends PrintStatementImpl implements StatementWrap {

	private final PrintStatement w;

	public PrintStatementWrap(PrintStatement e) {
		this.w = e;
		value = WrapUtils.valueItem(e.getValue());
	}

	@Override
	public ValueItem getValue() {
		return value;
	}

	@Override
	public void setValue(ValueItem value) {
		value = WrapUtils.valueItem(value);
		w.setValue(value);
	}

	public boolean accept(Visitor visitor) {
		if (visitor.visitEnter(this)) {
			Wrapped value = (Wrapped) getValue();
			value.accept(visitor);
		}
		boolean result = visitor.visitLeave(this);
		return result;
	}

}
